from rest_framework.response import Response
from rest_framework import status
from rest_framework.generics import ListAPIView

from .models import BannerModel, NavModel
from .serializers import BannerModelSerializer, NavModelSerializer


class BannerListView(ListAPIView):
    """轮播图列表"""
    queryset = BannerModel.objects.filter(is_show=True, is_delete=False).order_by('-orders').all()[:7]
    serializer_class = BannerModelSerializer


class NavListView(ListAPIView):
    """导航列表"""
    queryset = NavModel.objects.filter(is_show=True, is_delete=False).order_by('orders')[:5]
    serializer_class = NavModelSerializer







